package cn.hxzy.teacher.controller;

import cn.hxzy.common.domain.Examination;
import cn.hxzy.common.domain.vo.PageBeanVo;
import cn.hxzy.common.response.R;
import cn.hxzy.teacher.service.SysExamResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/results")
@RestController
public class SysExamResultsConatroller {
    @Autowired
    private SysExamResultService sysExamResultService;
    @RequestMapping("/list")
    public R<PageBeanVo> list(@RequestParam Integer pageNum, @RequestParam Integer pageSize, @RequestParam Integer Id){

        Integer ye=(pageNum-1)*pageSize;
        List<Examination> selecttid = sysExamResultService.selecttid(ye, pageSize, Id);
        Integer selectzong = sysExamResultService.selectzong(Id);
        PageBeanVo pp = new PageBeanVo();
        pp.setTotal(selectzong);
        pp.setItems(selecttid);
        return R.success(pp);
    }
}
